# 在此处进行 CMake 设置（最小版本号，项目名）
cmake_minimum_required(VERSION 3.10)
SET(CMAKE_TOOLCHAIN_FILE "/home/chyang/Public/vcpkg/scripts/buildsystems/vcpkg.cmake")
SET(CMAKE_CXX_STANDARD 17)

project(Test)

if(WIN32)
    MESSAGE(STATUS "current platform: Windows OS")
elseif(UNIX)
    message(STATUS "current platform: Linux OS")

    set(BASE_PATH /media/chyang/data/third_party/linux)
    set(CUDA_HOME ${BASE_PATH}/cuda/cuda_12.3)

    find_package(gRPC CONFIG REQUIRED)
    # note: 7 additional targets are not displayed.
#    target_link_libraries(main PRIVATE gRPC::gpr gRPC::grpc gRPC::grpc++ gRPC::grpc++_alts)


    #Find grpc
#    include_directories(/home/chyang/Public/grpc/install/include)
    include_directories(${gRPC_USE_FILE})
    message(STATUS "LLLL"${gRPC_DIR})
    message(STATUS "protobuf"${protobuf_DIR})
#    link_directories(/home/chyang/Public/grpc/install/lib)


    #Find Protobufer
    include_directories(${BASE_PATH}/protobuf/include)
    link_directories(${BASE_PATH}/protobuf/lib)

    #Find Opencv4
    include_directories(${BASE_PATH}/opencv/opencv4/include/)
    link_directories(${BASE_PATH}/opencv/opencv4/lib)



    file(GLOB YOLO8_DIR ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/*.cc)
    add_executable(rpc_client ${YOLO8_DIR})
    target_link_libraries(rpc_client opencv_core opencv_imgproc opencv_imgcodecs  opencv_videoio  protobuf
            gRPC::gpr gRPC::grpc gRPC::grpc++ gRPC::grpc++_alts)


endif()

